ofRegistry

fun <T> ofRegistry(defaultValue: Identifier, registry: Registry<T>): ValidatedIdentifier

Builds a ValidatedIdentifier based on an allowable registry of values

Allowable identifiers in this validation will be cached after their first polling. This is typically when suggestions are generated in a screen. Static registries like the ones passed into this method do not change while in game, so caching is beneficial with no downside.

Return

ValidatedIdentifier wrapping the provided default and registry

Author

fzzyhmstrs

Since

0.2.0, added caching 0.5.0

Parameters

defaultValue

the default value of the ValidatedIdentifier

registry

the registry whose ids are valid for this identifier


fun <T> ofRegistry(defaultValue: Identifier, registry: Registry<T>, predicate: Predicate<RegistryEntry<T>>): ValidatedIdentifier

Builds a ValidatedIdentifier based on an allowable registry of values, filtered by the provided predicate

Allowable identifiers in this validation will be cached after their first polling. This is typically when suggestions are generated in a screen. Static registries like the ones passed into this method do not change while in game, so caching is beneficial with no downside.

Return

ValidatedIdentifier wrapping the provided default and predicated registry

Author

fzzyhmstrs

Since

0.2.0, added caching 0.5.0

Parameters

defaultValue

the default value of the ValidatedIdentifier

registry

the registry whose ids are valid for this identifier

predicate

Predicate tests an allowable subset of the registry


fun <T> ofRegistry(defaultValue: Identifier, registry: Registry<T>, predicate: BiPredicate<Identifier, RegistryEntry<T>>): ValidatedIdentifier

Builds a ValidatedIdentifier based on an allowable registry of values, filtered by the provided predicate

Allowable identifiers in this validation will be cached after their first polling. This is typically when suggestions are generated in a screen. Static registries like the ones passed into this method do not change while in game, so caching is beneficial with no downside.

Return

ValidatedIdentifier wrapping the provided default and predicated registry

Author

fzzyhmstrs

Since

0.5.0

Parameters

defaultValue

the default value of the ValidatedIdentifier

registry

the registry whose ids are valid for this identifier

predicate

Predicate tests an allowable subset of the registry


fun <T> ofRegistry(registry: Registry<T>): ValidatedIdentifier

Deprecated

Only use for validation in a list or map

Builds a ValidatedIdentifier based on an allowable registry of values

Uses "minecraft:air" as the default value

Allowable identifiers in this validation will be cached after their first polling. This is typically when suggestions are generated in a screen. Static registries like the ones passed into this method do not change while in game, so caching is beneficial with no downside.

Return

ValidatedIdentifier wrapping the provided registry

Author

fzzyhmstrs

Since

0.2.0, added caching 0.5.0

Parameters

registry

the registry whose ids are valid for this identifier


fun <T> ofRegistry(registry: Registry<T>, predicate: Predicate<RegistryEntry<T>>): ValidatedIdentifier

Deprecated

Only use for validation in a list or map

Builds a ValidatedIdentifier based on an allowable registry of values, filtered by the provided predicate

Uses "minecraft:air" as the default value

Allowable identifiers in this validation will be cached after their first polling. This is typically when suggestions are generated in a screen. Static registries like the ones passed into this method do not change while in game, so caching is beneficial with no downside.

Return

ValidatedIdentifier wrapping the provided predicated registry

Author

fzzyhmstrs

Since

0.2.0, added caching 0.5.0

Parameters

registry

the registry whose ids are valid for this identifier

predicate

Predicate tests an allowable subset of the registry


fun <T> ofRegistry(registry: Registry<T>, predicate: BiPredicate<Identifier, RegistryEntry<T>>): ValidatedIdentifier

Deprecated

Only use for validation in a list or map

Builds a ValidatedIdentifier based on an allowable registry of values, filtered by the provided predicate

Uses "minecraft:air" as the default value

Allowable identifiers in this validation will be cached after their first polling. This is typically when suggestions are generated in a screen. Static registries like the ones passed into this method do not change while in game, so caching is beneficial with no downside.

Return

ValidatedIdentifier wrapping the provided predicated registry

Author

fzzyhmstrs

Since

0.2.0, added caching 0.5.0

Parameters

registry

the registry whose ids are valid for this identifier

predicate

BiPredicate tests an allowable subset of the registry